1. Field of the Invention
The present invention relates to a portable terminal device, a method for restoring a program for controlling execution of a plurality of programs, a method for terminating a program, and a computer program therefor.
Priority is claimed on Japanese Patent Application Nos. 2005-51332 and 2005-51333, filed Feb. 25, 2005, the contents of which are incorporated herein by reference.
2. Description of Related Art
With conventional techniques, in order to achieve multitask-like operations in which a plurality of application programs are started simultaneously in a single-task operating system (OS), a thread history of application programs being executed on a memory area of the OS is stored. The operating system monitors whether or not any application program requests an operation by means of a timer or the like. If there is an application program requesting an operation, an entry of that application program is added to the thread history of application programs and the operating system switches the control to the application program. When an operation is switched back to the application program that had been used, entries are read from the accumulated thread history starting from the one that was accumulated the earliest and the operation is switched in a one-by-one manner for the application of each read entry (see, for example, Japanese Unexamined Patent Application, First Publication No. H06-044084).
Japanese Unexamined Patent Application, First Publication No. H06-044084 discloses an example of such a technique for personal computers that have higher capacities of management than portable telephone terminals and less occurrences of sudden interruptions, such as incoming calls.
In conventional techniques for portable telephone terminals, when a startup of a plurality of application programs is instructed by means of a timer or the like, an operation of the next application program cannot start until switching and completing applications one-by-one. Furthermore, it is not possible to retain multiple statuses of the previous application programs. As a result, in the portable device of the conventional technique disclosed in Japanese Unexamined Patent Application, First Publication No. 2003-319020, application programs are monitored and controlled individually according to type or status upon an occurrence of events, such as an incoming call and the like.
In a typical portable telephone terminal, as shown in FIG. 1, when the terminal is turned on, a standby screen application program (hereinafter, an application program is referred to as an applet) for displaying a standby screen is started first. Afterward, in response to operations made by a user, applets for handling calls or electronic mails installed in the terminal as default by the developer of the portable telephone terminal hereinafter, such applets are referred to as “static applets”) and download applets that the user obtained on the Internet using the portable telephone terminal, such as games, are started sequentially. In such a case, in functional blocks for application management or the like installed in the portable telephone terminal, programs that are started are stacked in the memory in the order of startup for achieving the above-described multitask-like operations, as shown in FIG. 1. In this case, programs that are started earlier are suspended, and can restart in the reverse order of sticking order after programs that are started later are terminated.
It should be noted that the reason such a system is required in portable telephone terminals is as follows. In conventional systems other than portable telephone terminals, the operation of download applets, such as game programs, has no problem when a terminating of a trial version game program occurs. Because such terminals have not only a CPU to manage the OS but also another CPU and the like to manage operations of programs. However, in portable telephone terminals in which memory spaces are limited, it is required that a variety of application programs be managed in a single OS.
Oftentimes, download applets, such as the above game programs, are generally constructed to be able to terminate forcibly by depressing a predetermined key of a portable telephone terminal. In such a case, portable telephone terminals cannot maintain items of information of the order of startup of the applets, as in the example shown in FIG. 1.
For example, assuming a case in which a download applet A stars a static applet B after startup of the download applet A, and that static applet B starts a download applet B is stared, as shown in FIG. 1. In a more concrete example, it is assumed that the static applet B is a web browser program and the download applet B is a trial version game program that has part of the functions of a full product version and that has been obtained from a web page with the web browser by a user by means of operation of the portable telephone. Oftentimes, for the static applet B, parameters may be set for communicating with the download applet A from which the static applet B is started, or a callback function to the download applet A may be set in such a case.
However, if the download applet B that was started the last is forcibly terminated, the OS installed in the portable telephone terminal generally clears the information related to the download applet B from the memory retaining this data, as well as deleting other downloaded applets that have been suspended and the data thereof is stored in the memory from the viewpoint of conservation of the memory space. In other words, in the example shown in FIG. 1, the download applet A is terminated in response to the forced termination of the download applet B.
The termination of the download applet A may cause the following problems. More specifically, for the static applet B, parameters may be set for communicating with the download applet A from which the static applet B is started, or a callback function to the download applet A may be set, as described previously. For this reason, when the static applet is restored, an access to the download applet A that has been deleted from the memory may occur when an attempt is made to restore the static applet B. So this access may be reset as an abnormal operation by the OS that detects the access and treats it as an unauthorized access
In order to avoid this problem, the application management block may employ a structure in which, when the download applet A, i.e., an applet different from the download applet B, is terminated by the OS, the static applets A and B are also terminated and the standby screen applet is started after the termination of the download applet B, thereby preventing reset by the OS.
However, the above operation in which just a forced termination of a download program causes termination of all of the suspended download applets and static applets and the standby screen is started is not user-friendly since the users consider expects that applets are restored in the reverse order to the order of startup.